#ifndef QVIDEOMANAGER_H
#define QVIDEOMANAGER_H

#include <QtGui>
#include <QtSql>
#include <QtXml>
#include <QCryptographicHash>

class QVideoManager : public QMainWindow
{
    Q_OBJECT
    
public:

    QTextEdit *mLog;


    void readSettings();
    void writeSettings();
    QString getStoreDirPath();
    void setStoreDirPath(QString);
    void checkStoreDirPath();
    void getAllFileInfo(const QString&);
    void compareData();



    QVideoManager(QWidget *parent = 0);
    ~QVideoManager();

public slots:

    void setStoreDirPathSlot();
    void enrolVideoInfomationSlot(int);
    void addCategorySlot();
    void showSelectedCategorySlot(int);
    void showNotDefineSlot();
    void searchVideoSlot();
    void notdefineRefreshSlot();


private:


    QString mStoreDirPath;


    QHash<QString,QFileInfo*> *mFileInfoHash;
    QMap<int,QString> *mEnrolMap;
    int mEnrolTempIndex;
    QStringList mFilters;
    QSqlTableModel *mSQLvideoTableModel;

    QButtonGroup *mEnrolButtonGroup;
    QButtonGroup *mCategoryButtonGroup;
    int mCategoryButtonIndex;
    QWidget *mMainWidget;
    QPushButton *mStoreDirOpenButton;
    QPushButton *mManagerAndTorrentToggleButton;
    QPushButton *mCategoryAddButton;
    QLineEdit *mSearchLineEdit;
    QPushButton *mSearchButton;




    QWidget *mCategoryWidget;
    QTableWidget *mVideoTableWidget;
    QTableView *mVideoTableView;



    void init();
    void initWidget();
    void initConnect();

    void openDB();
    void createTable();

    void createCategoryArea();
    void connectCategoryModel();
    void connectVideoModel();

};

#endif // QVIDEOMANAGER_H
